﻿using YNTK.Common.Helper;
using YNTK.Common.Model;
using YNTK.SubDev.Entitys.Dto.ZyOaArticle;
using Mapster;
using System.Collections.Generic;

namespace YNTK.SubDev.Entitys.Mapper.ZyOaArticle
{
	public class Mapper : IRegister
	{
		public void Register(TypeAdapterConfig config)
		{
			config.ForType<ZyOaArticleCrInput, ZyOaArticleEntity>()
				.Map(dest => dest.ImgUrl, src => src.imgUrl.ToJson())
				;
			config.ForType<ZyOaArticleEntity, ZyOaArticleInfoOutput>()
				.Map(dest => dest.imgUrl, src => src.ImgUrl.ToObject<List<FileControlsModel>>())
				;
		}
	}
}